<div class="container">
    <div class="col-lg-12">
        <h4>Have a query?</h4>
        <small>Write to us:</small>
        <hr>
    </div>
    <?php
    $model = new ClassCourseQuery;
    $form = $this->beginWidget('GxActiveForm', array(
        'id' => 'class-course-query-form',
        'action' => $this->createUrl('ClassCourseQuery/Create'),
        'enableAjaxValidation' => true,
        'htmlOptions' => array('role' => 'form')
    ));
    ?>
    <?php echo $form->errorSummary($model); ?>
    <?php if ($class_course_type == 'classes') { ?>
        <?php echo $form->hiddenField($model, 'classes_id', array('maxlength' => 45, 'class' => 'field', 'placeholder' => 'Enter Name', 'value' => $classId)); ?>
    <?php } else { ?>
        <?php echo $form->hiddenField($model, 'courses_id', array('maxlength' => 45, 'class' => 'field', 'placeholder' => 'Enter Name', 'value' => $classId)); ?>
    <?php } ?>
    <div class="form-group">
        <div class="row">
            <div class="col-lg-6 column6 col-md-6 column6">
                <?php echo $form->textField($model, 'queryuser_name', array('maxlength' => 45, 'class' => 'form-control class-form', 'placeholder' => 'Enter Name')); ?>
                <?php echo $form->error($model, 'queryuser_name'); ?>
            </div>
            <div class="col-lg-6 column6 col-md-6 column6">
                <?php echo $form->textField($model, 'queryuser_email', array('maxlength' => 45, 'class' => 'form-control class-form', 'placeholder' => 'Enter Email')); ?>
                <?php echo $form->error($model, 'queryuser_email'); ?>

            </div>
        </div>
    </div><!--form group-->
    <div class="form-group"> 
        <div class="row">
            <div class="col-lg-12  column12">
                <?php echo $form->textArea($model, 'query_message', array('placeholder' => 'Write Query', 'class' => 'form-control class-form', 'style' => "min-height:86px")); ?>
                <?php echo $form->error($model, 'query_message'); ?>

            </div>                   
        </div>
    </div><!--form group-->
    <div class="row">
        <div class="col-lg-12 column12">   
            <?php
            echo CHtml::ajaxSubmitButton('Submit', CHtml::normalizeUrl(array('classCourseQuery/create')), array(
                'dataType' => 'json',
                'type' => 'post',
                'success' => 'function(data) {
                         $("#queryLoder").hide();  
                        if(data.status=="success"){
                         $("#class-course-query-form")[0].reset();
                        $("#class-course-query-form-formResult").show();
                         $("#class-course-query-form-formResult").html("Your Query submitted successfully.");                                             
                        }
                         else{
                        $.each(data, function(key, val) {   
                        $("#class-course-query-form-formResult").html("");
                        $("#class-course-query-form #"+key+"_em_").text(val);                                                    
                        $("#class-course-query-form #"+key+"_em_").show();
                        $("#class-course-query-form .common").css("margin-bottom","0px");
                        });
                        }       
                    }',
                'beforeSend' => 'function(){                        
                           $("#queryLoder").show();
                      }'
                    ), array('id' => 'query-btn', 'class' => 'query-btn '));
            ?> <div id="class-course-query-form-formResult"></div><div id="queryLoder" style="display: none"><img  class="reviewloader"src="<?php echo ThemePath(); ?>/images/myskill.gif"></img></div>    
        </div>
    </div>

    <?php $this->endWidget(); ?>               
</div>  




